package cn.hhchat.weekly.database;

import cn.hhchat.wp.entity.ConfigEntity;
import cn.hhchat.wp.entity.RoleEntity;
import cn.hhchat.wp.service.ConfigService;
import cn.hhchat.wp.service.RoleService;
import cn.hhchat.wp.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * Created this one by HMH on 2017/10/22.
 */
@SpringBootTest
@RunWith(SpringRunner.class)
public class CreateConfig {

    @Autowired
    private ConfigService configService;

    @Test
    public void createConfigs() {
        ConfigEntity allowReg = new ConfigEntity();
        allowReg.setName("allowReg");
        allowReg.setBoolValue(true);
        configService.save(allowReg);

        ConfigEntity allowLogin = new ConfigEntity();
        allowLogin.setName("allowLogin");
        allowLogin.setBoolValue(true);
        configService.save(allowLogin);
    }

}
